import numpy as np
from skeval.PR_core import PR_core

def f_measure(x, target):
  max_ = np.max(x)
  if max_!= 0:
      x = x / max_
  _, _, f1, _ = PR_core(x, target, 10)
  return float(max(f1))